import request from "@/utils/request";

//创建通告接口
export function createAddRequest(title: string,content:string,categoryId:string) {
  return request({
    url: '/admin/notice/create',
    method: 'post',
    data:{
      title,
      content,
      categoryId
    }
  });
}
//删除通告接口
export function createDeleteRequest(id:string) {
  const noticeId = id;
  return request({
    url: '/admin/notice/delete/'+noticeId,
    method: 'delete',
  });
}
//更新通告接口
export function createPutRequest(title: string,content:string,categoryId:string,id:string) {
  // const id = categoryId;
  return request({
    url: '/admin/notice/update/'+id,
    method: 'PUT',
      data:{
      title,
      content,
      categoryId,
    }
  });
}
//获取通告列表接口
export function createListRequest() {
  return request({
    url: '/admin/notice/list',
    method: 'get',
  });
}
